package com.wuxiaoqin.server.service;

import com.wuxiaoqin.server.entity.Users;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wuxiaoqin.uitls.respObj.RespBean;


import javax.servlet.http.HttpServletRequest;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author jobob
 * @since 2021-10-23
 */
public interface IUsersService extends IService<Users> {

    /**
     * 登录之后返回token
     *

     * @param username
     * @param password
     * @param code
     * @param request
     * @return
     */
    RespBean login(String username, String password, String code, HttpServletRequest request) throws InvalidKeySpecException, NoSuchAlgorithmException;


    /**
     * 注册
     * @param username
     * @param email
     * @param phone
     * @param password
     * @param request
     * @return
     */
    RespBean register(String username, String email, String phone,String password, HttpServletRequest request) throws InvalidKeySpecException, NoSuchAlgorithmException;
    /**
     * 根据用户名获取用户
     * @param uName
     * @return
     */
    Users getUsersByUserPhone(String uName);


    RespBean ifHaveName(String name);

    RespBean passmod(String orgPass, String newPass) throws InvalidKeySpecException, NoSuchAlgorithmException;

    RespBean userInfoModify(String name, String sex, String email, String signature);

    public Users getCurrentUser();



}
